import body from '@/components/body'
import childView from '@/components/appMain.vue'

const templateTree = resolve => {
  require(['@/views/interface/template/tree.vue'], resolve)
}; //
const templateList = resolve => {
  require(['@/views/interface/template/list.vue'], resolve)
}; //
const templateEdit = resolve => {
  require(['@/views/interface/template/edit.vue'], resolve)
}; //
const templateReName = resolve => {
  require(['@/views/interface/template/rename.vue'], resolve)
}; //
const templateSetting = resolve => {
  require(['@/views/interface/template/setting.vue'], resolve)
}; //
const resourceTree = resolve => {
  require(['@/views/interface/resource/tree.vue'], resolve)
}; //
const resourceList = resolve => {
  require(['@/views/interface/resource/list.vue'], resolve)
}; //
const resourceEdit = resolve => {
  require(['@/views/interface/resource/edit.vue'], resolve)
}; //
const resourceReName = resolve => {
  require(['@/views/interface/resource/rename.vue'], resolve)
}; //
const interfaceRouter = {
  path: '/interface',
  name: '界面',
  component: body,
  iconCls: 'icon-windowso',
  children: [
    {
      path: '/templatelist',
      name: '模板',
      component: childView,
      isParent: true,
      redirect: '/template/mange',
      children: [
        {
          path: '/template/mange',
          name: '模板管理',
          component: templateTree,
          hidden: true,
          children: [
            {
              path: '/templatelist',
              name: '模板列表',
              component: templateList,
              hidden: true
            },
            {
              path: '/templateadd',
              name: '模板添加',
              component: templateEdit,
              hidden: true
            },
            {
              path: '/templateedit',
              name: '模板修改',
              component: templateEdit,
              hidden: true
            },
            {
              path: '/templaterename',
              name: '模板重命名',
              component: templateReName,
              hidden: true
            }, {
              path: '/templatesetting',
              name: '模板设置',
              component: templateSetting,
              hidden: true
            }
          ]
        }
      ]
    },
    {
      path: '/resourcelist',
      name: '资源',
      isParent: true,
      component: childView,
      redirect: '/resource/mange',
      children: [
        {
          path: '/resource/mange',
          name: '资源管理',
          component: resourceTree,
          hidden: true,

          children: [
            {
              path: '/resourcelist',
              name: '资源列表',
              component: resourceList,
              hidden: true
            },
            {
              path: '/resourceadd',
              meta: {role: 'resourceadd'},
              name: '资源添加',
              component: resourceEdit,
              hidden: true
            },
            {
              path: '/resourceedit',
              name: '资源修改',
              component: resourceEdit,
              hidden: true
            },
            {
              path: '/resourcerename',
              name: '资源重命名',
              component: resourceReName,
              hidden: true
            },
          ]
        }
      ]
    }
  ]
}
export default interfaceRouter
